package com.geek.demo01.repository;

import com.geek.demo01.model.Student;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface StudentRepository extends JpaRepository<Student, String>, JpaSpecificationExecutor<Student> {
    List<Student> findByAge(Integer age); //自动生成sql语句

    @Query(value = "select * from student where name = ?1", nativeQuery = true)
    Student findByName(String name);
}
